-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ilps22qs sensor support to lps2xdf driver #79850
base: main
Are you sure you want to change the base?
Conversation
Move api_lps2xdf_handle_interrupt() API inside the CONFIG_LPS2XDF_TRIGGER ifdef, because it should be defined only in that case. Signed-off-by: Armando Visconti <[email protected]>
Add a generic lps2xdf_config_int() API to configure device interrupt mode, and implement the specific routines for lps22df and lps28dfw. Signed-off-by: Armando Visconti <[email protected]>
Change I2C into I3C as it is a typo. Signed-off-by: Armando Visconti <[email protected]>
6c417ca
to
0156bb4
Compare
The ILPS22QS is an ultra-compact piezoresistive absolute pressure sensor which functions as a digital output barometer, supporting dual full-scale up to user- selectable 4060 hPa. The device delivers ultra-low pressure noise with very low power consumption and operates over an extended temperature range from -40 °C to +105 °C. (https://www.st.com/en/mems-and-sensors/ilps22qs.html) Signed-off-by: Armando Visconti <[email protected]>
Add support to ILPS22QS barometer. Signed-off-by: Armando Visconti <[email protected]>
Add ilps22qs data streaming. Signed-off-by: Armando Visconti <[email protected]>
0156bb4
to
e7301d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just saw some minor points.
Tested the updated driver with a custom board that has the lps28dfw
device. I tested interrupt mode and both scales (1260 hPA and 4060 hPA). Works well.
Saw some unchanged copyright notices from 2023, not sure if you want to update them.
status = "okay"; | ||
odr = <LPS2xDF_DT_ODR_10HZ>; | ||
lpf = <LPS2xDF_DT_LP_FILTER_ODR_4>; | ||
avg = <LPS2xDF_DT_AVG_128_SAMPLES>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could add a value for fs
, as the sensor supports dual full-scale.
lps28dfw defines
fs = <LPS28DFW_DT_FS_MODE_1_1260>;
@@ -6,6 +6,7 @@ | |||
* SPDX-License-Identifier: Apache-2.0 | |||
* | |||
* Datasheet: | |||
* https://www.st.com/resource/en/datasheet/ilps22qs.pdf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are adding a link to the datasheet in lps2xdf.c
, but not in lps2xdf.h
.
What do you think of removing the set of links from one of the files?
*/ | ||
static int ilps22qs_trigger_set(const struct device *dev, | ||
const struct sensor_trigger *trig, | ||
sensor_trigger_handler_t handler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
The ILPS22QS is an ultra-compact piezoresistive absolute pressure and temperature sensor from ST Microelectronics.
https://www.st.com/en/mems-and-sensors/ilps22qs.html
It is register compatible with lps2xdf, which already handles lps22df and lps28dfw, so we will use it to handle ilps22qs as well. During the implementation few issues/improvements have been found and fixed.
The new driver has been verified on STM steval_stwinbx1 board.